package com.example.spring_rabbit.testContoller;


import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author wangc
 * @date 2022/9/5 16:11
 */
@RestController
public class test {
    @Resource(name = "redisTemplateDb0")
    private StringRedisTemplate redisTemplateDb0;

    @Resource(name = "redisTemplateDb1")
    private StringRedisTemplate redisTemplateDb1;
    @GetMapping("/a")
    public  void  aaa(){
        redisTemplateDb0.opsForValue().set("aaa","aaaa");
        System.out.println(redisTemplateDb0.opsForValue().get("aaa"));

        redisTemplateDb1.opsForValue().set("baaa","baaaa");
        System.out.println(redisTemplateDb1.opsForValue().get("baaa"));
    }

}
